package com.appspot.entourage.databasemanager;

import java.util.List;

import com.appspot.entourage.common.Person;
import com.appspot.entourage.databasemanager.DataBaseManager;

import com.google.appengine.tools.development.testing.*;

import org.junit.*;
import org.junit.Test;

public class TestDb {

    private LocalServiceTestHelper helper =
        new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());

    @Before
    public void setUp() {
      LocalDatastoreServiceTestConfig config = new LocalDatastoreServiceTestConfig();
      config.setBackingStoreLocation("data/local_db.bin");
      config.setNoStorage(false);
      config.setStoreDelayMs(500);
      helper = new LocalServiceTestHelper(config);
      helper.setUp();
    }

    @After
    public void tearDown() {
        helper.tearDown();
    }

    // run this test twice to prove we're not leaking any state across tests
   @Test
    public void doTest() throws Exception {
	   DataBaseManager.init(3, null);
		
		Person Next=DataBaseManager.getNextPerson();
	
		Person Ata = new Person("Ataturk", "12345678986", "www.wikipedia.com/ataturk"); 
		
		Person Zub = new Person("Zubeyde", "12345ioou8986", "www.wikipedia.com/zubeyde");
		
		Person Ziy = new Person("Ziya", "1234pmlkb8986", "www.wikipedia.com/ziya");

		List<Person> targets = null;
		targets.add(Zub);
    	targets.add(Ziy);
		
		DataBaseManager.insertLinks(Ata, targets);
    }

   
}